package com.project.handlChain;

import com.project.handle.HomeRichHandle;
import com.project.pojo.RiskController;
import com.project.utils.ErrorMessage;
import com.project.utils.ResponseData;
import com.project.utils.ResponseDataUtil;
import com.project.vo.HomeMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

@Component
public class HomeRichHandleChain {
    @Autowired
    List<HomeRichHandle> list=new ArrayList<>();

    boolean isContinue=true;

    public void handle(HomeMessage homeMessage, List<RiskController> riskRule,List<ErrorMessage> errorMessageList){
        if (!Objects.isNull(list)){

            for (HomeRichHandle handle:list){

              handle.homeRiskAssess(homeMessage,riskRule,errorMessageList);
                if (errorMessageList.size()>0){

                    break;
                }

            }


        }


    }


}
